<%@ page import="java.lang.StringBuilder"%>
<%@ page import="cs236369.hw5.axis2.ypages.YellowPagesClient"%>

<%@page language="java" contentType="text/html; charset=windows-1255" pageEncoding="windows-1255"%>
<!DOCTYPE html>
<html>
    <head>
        <title>CrowdSourcing - Yellow Pages</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
        <link rel="icon" href="crowdSourcingLogo.png" type="image/x-icon">
        <link rel="stylesheet" type="text/css" title="index_css" href="/${project.build.finalName}/crowd/css/yellowPages.css">
        <script type="text/javascript" src="/${project.build.finalName}/js/jquery-1.8.0.js"></script>
        <script type="text/javascript" src="/${project.build.finalName}/crowd/js/yellowPages.js"> </script>
    </head>
    <body>
    
        <%! 
            String getEndPoints()
            {
                StringBuilder builder = new StringBuilder();
                YellowPagesClient y = new YellowPagesClient();                
                for (String s: y.getEndPoints())
                {
                    
                    builder.append("<input type=\"radio\" name=\"");
                    builder.append("endpoint");
                    builder.append("\" value=\"");
                    builder.append(s);
                    builder.append("\" onclick=\"onCheckedService()\"/>");
                    builder.append(s);
                    builder.append("<br />");
                    builder.append("\n\t\t\t\t\t\t");
                }
                return builder.toString();
            }
        %>
        <form id="search_options_form">
        
            <table class="center">
                <tr>
                    <th>services</th>
                    <th>search method</th>
                </tr>
                <tr>
                    <td>
                        <%= getEndPoints() %>
                    </td>
                    <td>
                        <div id="search_options"></div>
                            
                        <input id="search_button" type="button" value="Send" onclick="searchWebServices(this.form)" hidden="true"/>
                    </td>
                </tr>
            </table> 
        </form>
    </body>
</html>
